<?php
require_once APPLICATION_PATH.'/../library/Sozfo/Form.php'; 
class Application_Form_Edit_Block extends Sozfo_Form
{

    public function init()
    {
        $this->setMethod('post');

        $languages = Application_Model_Language::getList();

        if (!empty($languages) && is_array($languages))
        {

            // Add input for key
            $this->addElement('text', 'key', array(
                'label'      => 'Key',
                'required'   => true,
                'filters'    => array('StringTrim'),
                'validators' => array(
                    array('validator' => 'StringLength', 'options' => array(0, 64))
                )
            ));

            foreach ($languages as $language)
            {
                // Add input for content
                $this->addElement('tinyMce', 'content_' . $language->getId(), array(
                    'label'         => 'Content',
                    'required'      => true,
                    'cols'          => '50',
                    'rows'          => '10',
                    'editorOptions' => new Zend_Config_Ini(APPLICATION_PATH . '/configs/tinymce.ini', 'moderator')
                ));
            }
        }

    }
}

